<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
  "http://colorer.sf.net/2003/hrc.dtd">
<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">
   <type name="ahdl">
      <annotation>
         <documentation><![CDATA[
           AHDL (Altera HDL)
         ]]></documentation>
         <contributors><![CDATA[
           Artyom Bikov <a_bikov@mail.ru> Initial version

         ]]></contributors>
      </annotation>

      <import type="def"/>

      <region name="ahdlComment" parent="def:Comment"/>
      <region name="ahdlNumber" parent="def:Number"/>
      <region name="ahdlString" parent="def:String"/>
      <region name="ahdlSymbol" parent="def:Symbol"/>
      <region name="ahdlKeyword" parent="def:Keyword"/>
      <region name="ahdlTypeKeyword" parent="def:TypeKeyword"/>
      <region name="ahdlPrimitive" parent="def:String"/>
      <region name="ahdlMacrofunction" parent="def:String"/>
      <region name="ahdlError" parent="def:ErrorText"/>

      <scheme name="ahdl">

      <!-- 1. Comments -->
        <block start="/\%/" end="/\%/" scheme="Comment" region="ahdlComment"/>
        <regexp match="/--(.*)$/" region0="ahdlComment"/> <!-- VHDL-style comment also. /-->

      <!-- 2. Numbers -->
        <inherit scheme="def:DecNumber"/>
        <regexp match='/B"[_0-1Xx]+"/i' region0="ahdlNumber"/>
        <regexp match='/H"[_\dA-Fa-fXx]+"/i' region0="ahdlNumber"/>
        <regexp match='/Q"[_0-3Xx]+"/i' region0="ahdlNumber"/>
        <regexp match='/O"[_0-7Xx]+"/i' region0="ahdlNumber"/>

        <regexp match='/B"[_0-1Xx]*?([^_0-1Xx]).*?"/i' region0="ahdlError"/>
        <regexp match='/H"[_\dA-Fa-fXx]*?([^_\dA-Fa-fXx]).*?"/i' region0="ahdlError"/>
        <regexp match='/Q"[_0-3Xx]*?([^_0-3Xx]).*?"/i' region0="ahdlError"/>
        <regexp match='/O"[_0-7Xx]*?([^_0-7Xx]).*?"/i' region0="ahdlError"/>

      <!-- 3. Strings -->
        <inherit scheme="c:String"/>

      <!-- 4. Symbols -->
        <keywords ignorecase="yes" region="ahdlSymbol">
          <symb name="=="/>
          <symb name="!="/>
          <symb name="&lt;"/>
          <symb name="&gt;"/>
          <symb name="&lt;="/>
          <symb name="&gt;="/>
          <symb name="!"/>
          <symb name="&amp;"/>
          <symb name="#"/>
          <symb name="$"/>
          <symb name="!&amp;"/>
          <symb name="!#"/>
          <symb name="!$"/>
          <!--symb name="x"/-->
          <!--symb name="z"/-->
          <symb name="="/>
          <symb name="("/>
          <symb name=")"/>
          <symb name=";"/>
          <symb name="["/>
          <symb name="]"/>
          <symb name=".."/>
          <symb name="=&gt;"/> <!-- arrow symbol -->
        </keywords>

      <!-- 5. Keywords -->
        <keywords ignorecase="yes" region="ahdlKeyword">
          <word name="?"/> <!-- ternary operator  -->
          <word name="and"/>
          <word name="assert"/>
          <word name="begin"/>
          <word name="bits"/>
          <word name="case"/>
          <word name="clique"/>
          <word name="constant"/>
          <word name="defaults"/>
          <word name="define"/>
          <word name="design"/>
          <word name="device"/>
          <word name="else"/>
          <word name="elsif"/>
          <word name="end"/>
          <word name="for"/>
          <word name="function"/>
          <word name="generate"/>
          <word name="gnd"/>
          <word name="help_id"/>
          <word name="if"/>
          <word name="include"/>
          <word name="is"/>
          <word name="machine"/>
          <word name="nand"/>
          <word name="nor"/>
          <word name="not"/>
          <word name="of"/>
          <word name="options"/>
          <word name="or"/>
          <word name="others"/>
          <word name="parameters"/>
          <word name="report"/>
          <word name="returns"/>
          <word name="segments"/>
          <word name="severity"/>
          <word name="states"/>
          <word name="subdesign"/>
          <word name="table"/>
          <word name="then"/>
          <word name="title"/>
          <word name="to"/>
          <word name="variable"/>
          <word name="vcc"/>
          <word name="when"/>
          <word name="with"/>
          <word name="xnor"/>
          <word name="xor"/>

          <word name="ceil"/>
          <word name="div"/>
          <word name="floor"/>
          <word name="log2"/>
          <word name="mod"/>
          <word name="used"/>
        </keywords>

      <!-- 6. Type keywords (like) -->
        <keywords ignorecase="yes" region="ahdlTypeKeyword">
          <word name="bidir"/>
          <word name="buried"/>
          <word name="connected_pins"/>
          <word name="input"/>
          <word name="node"/>
          <word name="output"/>
          <word name="tri_state_node"/>
          <word name="memory"/>
        </keywords>

      <!-- 7. Build-in primitives -->
        <keywords ignorecase="yes" region="ahdlPrimitive">
          <word name="carry"/>
          <word name="cascade"/>
          <word name="global"/>
          <word name="dff"/>
          <word name="dffe"/>
          <word name="exp"/>
          <word name="jkff"/>
          <word name="jkfe"/>
          <word name="latch"/>
          <word name="lcell"/>
          <word name="mcell"/>
          <word name="opndrn"/>
          <word name="soft"/>
          <word name="srff"/>
          <word name="srffe"/>
          <word name="tff"/>
          <word name="tffe"/>
          <word name="tri"/>
          <word name="wire"/>
        </keywords>

        <keywords ignorecase="yes" region="ahdlMacrofunction">
          <!-- A.Б. сюда можно было бы запихнуть всю 74-ю серию, -->
          <!-- но не думаю, что ее использование есть good style -->
          <word name="enadff"/>
          <word name="expdff"/>
          <word name="explatch"/>
          <word name="inpltch"/>
          <word name="nandltch"/>
          <word name="norltch"/>

        </keywords>

      <!-- Paired items-->
        <!-- to Cail: не знаю, как настроить выделение парной скобки -->
        <!-- (к той, что над курсором) -->
        <block start="/(\()/" end="/(\))/" scheme="ahdl" region00="ahdlSymbol" region01="PairStart" region10="ahdlSymbol" region11="PairEnd"/>
        <block start="/(\[)/" end="/(\])/" scheme="ahdl" region00="ahdlSymbol" region01="PairStart" region10="ahdlSymbol" region11="PairEnd"/>

        <!-- to Cail: тоже самое, хотелось бы выделять парный элемент -->
        <block start="/^\s*(if)/i" end="/^\s*(end\s+if)/" scheme="ahdl" region00="ahdlKeyword" region01="PairStart" region10="ahdlKeyword" region11="PairEnd"/>
        <block start="/^\s*(case)/i" end="/^\s*(end\s+case)/" scheme="ahdl" region00="ahdlKeyword" region01="PairStart" region10="ahdlKeyword" region11="PairEnd"/>
        <block start="/^\s*(defaults)/i" end="/^\s*(end\s+defaults)/" scheme="ahdl" region00="ahdlKeyword" region01="PairStart" region10="ahdlKeyword" region11="PairEnd"/>
        <block start="/^\s*(table)/i" end="/^\s*(end\s+table)/" scheme="ahdl" region00="ahdlKeyword" region01="PairStart" region10="ahdlKeyword" region11="PairEnd"/>
        <block start="/^\s*(if.+generate)$/i" end="/^\s*(end\s+generate)/" scheme="ahdl" region00="ahdlKeyword" region01="PairStart" region10="ahdlKeyword" region11="PairEnd"/>

      </scheme>
    
   </type>
</hrc>
<!-- ***** BEGIN LICENSE BLOCK *****
   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
   -
   - The contents of this file are subject to the Mozilla Public License Version
   - 1.1 (the "License"); you may not use this file except in compliance with
   - the License. You may obtain a copy of the License at
   - http://www.mozilla.org/MPL/
   -
   - Software distributed under the License is distributed on an "AS IS" basis,
   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   - for the specific language governing rights and limitations under the
   - License.
   -
   - The Original Code is the Colorer Library.
   -
   - The Initial Developer of the Original Code is
   - Artyom Bikov <a_bikov@mail.ru>
   - Portions created by the Initial Developer are Copyright (C) 2006
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either the GNU General Public License Version 2 or later (the "GPL"), or
   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   - in which case the provisions of the GPL or the LGPL are applicable instead
   - of those above. If you wish to allow use of your version of this file only
   - under the terms of either the GPL or the LGPL, and not to allow others to
   - use your version of this file under the terms of the MPL, indicate your
   - decision by deleting the provisions above and replace them with the notice
   - and other provisions required by the LGPL or the GPL. If you do not delete
   - the provisions above, a recipient may use your version of this file under
   - the terms of any one of the MPL, the GPL or the LGPL.
   -
   - ***** END LICENSE BLOCK ***** -->
